<?php
namespace api;
use api\bdd\table as nsTable;

error_reporting(E_ALL);

define("GAME", true);

include 'master.php';

$pdo = bdd\DatabaseConnection::get();

$query = new nsTable\perso();


$result = $query->loadById('Chargement',1,$pdo);


/*$sql = 'SELECT * FROM `race`';
$handle = $pdo->handle();
$result = $handle->query($sql);*/

echo "<hr><table border='1'>";
$titre = true;

while($ligne = $result->fetch(\PDO::FETCH_ASSOC)) {
	echo "<tr>";
	if($titre)
	{
		foreach($ligne as $key => $value) {
			echo "<th>$key</th>";
		}
		echo "</tr><tr>";
		$titre = false;
	}
	
	foreach($ligne as $value) {
		echo "<td>$value</td>";
	}
	echo "</tr>";
	//echo $ligne['id'] . ' ' . $ligne['nom'] . ' ' . $ligne['pv_base'] . '<br>';
}
echo "</table>";

?>